<?php 
 
namespace app\common\model;

use app\common\model\BaseModel;
use app\common\traits\ModelTrait;
use app\common\utils\JsonService;
/**
* This is the model class for table "{ptf_brand}".
*
* @property int $id 品牌表 
* @property string $name 品牌名称
* @property string $logo 品牌logo
* @property string $desc 品牌描述
* @property string $url 品牌地址
* @property int $sort 排序 
* @property int $parent_cat_id 分类id 
* @property int $cat_id 分类id 
* @property int $is_hot 是否推荐 
*/
class Brand extends BaseModel{

    protected $pk = 'id';
    protected $name = 'brand';

    use ModelTrait;
    protected $autoWriteTimestamp = true;
    //protected $dateFormat = 'Y-m-d';
    //protected $createTime = 'create_time';
    //protected $updateTime = 'update_time';

    /**
    * {@inheritdoc}
    */
    public function attributeLabels()
    {
        return [
            'id' => '品牌表',
            'name' => '品牌名称',
            'logo' => '品牌logo',
            'desc' => '品牌描述',
            'url' => '品牌地址',
            'sort' => '排序',
            'parent_cat_id' => '分类id',
            'cat_id' => '分类id',
            'is_hot' => '是否推荐',
        ];
    }

    public function getCategory(){
        return $this->hasOne('Category','id','cat_id');
    }
}


?>